package club.chenlinghong.order.util;

import com.netflix.discovery.util.StringUtil;

import java.util.Random;

/**
 * @Description TODO
 * @Author chenlinghong
 * @Date 2019/7/1 13:23
 * @Version V1.0
 */
public class KeyUtil {

    /**
     * 生成唯一主键
     * 格式：时间+随机数
     */
    public static synchronized String genUniqueKey() {
        Random random = new Random();
        Integer number = random.nextInt(9000000) + 1000000;
        return System.currentTimeMillis() + String.valueOf(number);
    }
}
